<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: Forpastime <Forpastime@qq.com>
// +----------------------------------------------------------------------

namespace api\partner\model;

use think\Model;
use api\common\controller\CommonController;

class NoticeModel extends Model
{
    protected $name="partner_notice";
    public function list($partnerId,$page)
    {
        $res = $this->where(['partner_id'=>$partnerId])
            ->withAttr('create_time',function($v){
                return CommonController::timeFormat($v);
            })
            ->order('id desc')
            ->page($page)
            ->select();

        return $res;
    }

    public function updateNotice($filter,$data)
    {
        $res = $this->where($filter)->update($data);
        return $res;
    }
}